{config_load file="global.conf"}
{config_load file="menu_langselector.conf" section="`$lang`"}

<script type="text/javascript">
 {literal}


function langList(){
	var vsb;
	if (document.getElementById("langList").style.visibility=="visible") vsb = "hidden";
	else vsb = "visible";
	document.getElementById("langList").style.visibility = vsb;
}

function setLang(lng){
	document.getElementById("selectlang_lang").value = lng;
	document.getElementById("selectlang").submit();
}

 {/literal}
 </script>

<form method="post" name="selectlang" id="selectlang">
<table width="100%" height="22px;" border="0" cellpadding="0" cellspacing="0"
style="vertical-align:top; margin-top:20px; table-layout:fixed; ">
<tr><td width="1" class="langCorner"><img src="{#images_dir#}/lanselector_cl.gif"></td>
<td class="langBB" width="1"><img src="{#images_dir#}/lanselector_corner.gif"></td>
<td class="langBB" width="60px;" style="font-size:11px; color:#FFFFFF; vertical-align:middle; text-align:left;">
	{section name=item loop=$select.list}
			{if $select.list[item].value==$select.value }
				{if $select.list[item].value=="en"}
					{assign var="curr_lang" value=#menu_langselector__msgLangName1#}
				{elseif $select.list[item].value=="ru"}
					{assign var="curr_lang" value=#menu_langselector__msgLangName2#}
				{/if}
			{/if}
	  	{/section}
	{if $select.caption}
	 	&nbsp;&nbsp;<label for="{$select.name}">{$select.caption}</label>&nbsp;
	{/if}
</td><td class="langBB" width="95px;" style="text-align:right;">
	<nobr>
	{$curr_lang}
	&nbsp;
	<img src="{#images_dir#}/flag_{$select.value}.gif" style="position: relative; top: 2px;" class="langFlag">
	<img style="cursor:pointer" src="{#images_dir#}/lanorange.gif" onClick="langList();">
	</nobr>
	<input type="hidden" name="selectlang_lang" id="selectlang_lang" value="">
</td>
<td class="langBB" width="1"><img src="{#images_dir#}/lanselector_corner.gif"></td>
<td width="1"><img src="{#images_dir#}/lanselector_cl.gif"></td>
</tr>
</table>
<div align="right" class="langList"
	style="font-size:11px; color:#FFFFFF; width:100px;
	position: relative; top: 2px; right: -38px;
	visibility: hidden;" id="langList">
  {section name=item loop=$select.list}
  	{if $select.list[item].value!=$select.value }
  		<nobr><span onClick="setLang('{$select.list[item].value}')" style="cursor:pointer"><a>{$select.list[item].name}</a>
		&nbsp;
		<img style="cursor:pointer" src="{#images_dir#}/flag_{$select.list[item].value}.gif" onClick="setLang('{$select.list[item].value}')"></span></nobr>
  	{/if}
  {/section}
</div>

</form>
